Simply do this
Code:local.weapon targetname ""
Simply do this
Code:local.weapon targetname ""
Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.
local.weapon targetname ""
Still resulting in script error
Script Error: command 'targetname' applied to NIL
Yea i dnt no the difference between NIL and NULL i read it somewhere but forget it or i didnt quite understand it
Purple's Playground
OBJ : 103.29.85.127:12203
xfire: purpleelephant1au
email: purpleelephant1au@gmail.com
skydrive: PurpleElephantSkydrive
Taken from another forum....
Assuming we're talking about Objetive-C:nil (all lower-case) is a null pointer to an Objective-C object.
Nil (capitalized) is a null pointer to an Objective-C class.
NULL (all caps) is a null pointer to anything else.
So, conceptually, they mean the same thing but for different categories of things. They all have the same representation, too; they all happen to have the numeric value of 0.
It means getactiveweap returned nothing.
Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.
I should add Im using the
local.player weaponcommand dual targetname ("weap" + local.player.entnum )
local.player.weapon = $("weap" + local.player.entnum ).model
Method to check weapon
Purple's Playground
OBJ : 103.29.85.127:12203
xfire: purpleelephant1au
email: purpleelephant1au@gmail.com
skydrive: PurpleElephantSkydrive
It would be great if I actually knew what you were using at the occurrence of the error but try this:
Code:while (local.player && !local.weapon) { local.player weaponcommand dual targetname ("weap" + local.player.entnum ) local.weapon = $("weap" + local.player.entnum) waitframe } local.player.weapon = local.weapon.model local.player iprint ("am now holding weapon " + local.player.weapon)
Last edited by Sor; November 25th, 2012 at 05:24 PM.
Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.
Here is the weapon check part of it
local.notallowed is where the weapon models are stored which is altered via cvars , but that works . It all works i just dnt see why i need to add theCode://////////////////////////////////////////////////////////// ////////////// Weapon Check Part /////////////////////////// if(local.player != NULL && local.player != NIL && isAlive(local.player) && local.player.dmteam != spectator) { local.player weaponcommand dual targetname ("weap" + local.player.entnum ) local.player.weapon = $("weap" + local.player.entnum ).model if(local.player.weapon != NIL && local.player.weapon != NULL) { for (local.i = 1; local.i <= local.notallowed.size; local.i++) { if(local.player.weapon == local.notallowed[local.i]) { local.player take local.notallowed[local.i] if(getcvar(pe_weapon_choice) != "1") { local.player give models/weapons/KAR98sniper.tik local.player use models/weapons/KAR98sniper.tik } if(getcvar(pe_weapon_choice) == "1") { local.player spectator local.player stufftext "pushmenu SelectPrimaryWeapon" } if(getcvar(pe_weapon_message) == "1") { local.player iprint ("The Weapon you chose is unavailable") 1 local.player iprint (local.allowed) 1 //local.player iprint ("So here is a Sniper") 1 } } } } }
local.player.weapon targetname ""
EDIT :: Just tested it on my server will a few people and it works perfectly and producing same errors but still works fine
Last edited by Purple Elephant1au; November 28th, 2012 at 04:27 AM.
Purple's Playground
OBJ : 103.29.85.127:12203
xfire: purpleelephant1au
email: purpleelephant1au@gmail.com
skydrive: PurpleElephantSkydrive